{% extends 'base.html' %}
{%import '_macros.html' as macros%}
{% block title %}翻唱区{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static',filename='css/index.css') }}">
{% endblock %}
{% block zuopin1 %}active{% endblock %}
{% block ind %}
    <div class="row">
        <div class="hd">翻唱区</div>
        <ul class="sss">
            {% for a in posts %}
                <li class="thumbnail">
                    <div class="caption1" style="float: left;width:45%;height:290px;overflow:hidden">
                    <a href="{{ url_for('static', filename=a['photo'])}}" target="_blank"><img src="{{ url_for('static', filename=a['photo'])}}" style="margin:0;border:0;width:100%;height: auto;" alt="..." ></a>
                    </div>
                    <div class="caption" style="float: right; width: 50%">
                        <h3 class="p2" title="{{ a['name'] }}"><a href="{{ a['Address'] }}" target="_blank">{{ a['name'] }}</a></h3>
                        <p class="p2" title="{{ a['singer'] }}">歌手：{{ a['singer'] }}</p>
                        <p class="p2" title="{{ a['Original_song'] }}">原唱：{{ a['Original_song'] }}</p>
                        <p><a href="javascript:void(0)" class="click_pop" onclick="op({{ a['id'] }})">查看歌词</a></p>
                        <p style="text-align: right">
                          {% if session == {} %}
                              <a href="javascript:void(0)" onclick="alert('请先登录');" class="btn btn-primary" role="button">比心<span class="badge">{{ a['give_up'] }}</span></a>
                          {% else %}
                              <a href="javascript:void(0)" onclick="om({{ a['id'] }},{{ session['mid'] }})" class="btn btn-primary" role="button">比心<span class="badge">{{ a['give_up'] }}</span></a>
{#                          {{ url_for('Dispose',id=a['id'],meth=1,mid=session['mid']) }}#}
                          {% endif %}
                          <a href="javascript:void(0)" onclick="alert('手下留情');" class="btn btn-default" role="button">比屎<span class="badge">0</span></a></p>
                    </div>
                </li>
            {% endfor %}
            <div class="bgPop"></div>
            <div class="pop">
            <div class="pop-content">
                <p style="font-size:150%" id="textttt"></p>
                </div>
            </div>
         <script>
            $(document).ready(function () {
        $('.bgPop').click(function () {
            $('.bgPop,.pop').hide();
        });
        $('.click_pop').click(function () {
            $('.bgPop,.pop').show();
        });
    });
</script>
        </ul>
    </div>
    {% if posts != [] %}
        {{macros.pagination_widget(pagination,'Exhibition')}}
    {% endif %}
{% endblock %}
{% block jsna %}
<script>
        function op(a) {
            jQuery.get("{{ url_for('workexib.create_2')}}", { Lyric: a}, function (cc) {
                    $('#textttt').html(cc.message);
                });
        }
{#        比心#}
        function om(id,mid) {
            jQuery.get("{{ url_for('Dispose')}}", { id: id, mid:mid, meth:1}, function (cc) {
                if (cc.state == 'success') {
                    alert("投票成功");
                    window.location.href = cc.url
                }else if (cc.state == 'fail') {
                    alert(cc.message)
                }
            });
        }
</script>
{% endblock %}